#pragma once
#include "stdafx.h"
#include <UIRibbon.h>
#include <string>

using namespace std;

 MIDL_INTERFACE("3e617381-a1e0-4d9e-beb2-dd6089c466bb")
    IRibbonCommandItem : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE Initialize(PCWSTR commandName, UINT32 nCmdID); 
		virtual HRESULT STDMETHODCALLTYPE GetCommandId(UINT32 *commandId);
    };


class CRibbonCommandItem : public CComObjectRootEx<CComMultiThreadModel>, public IUISimplePropertySet, public IRibbonCommandItem
{
private:
	wstring m_commandName;
	UINT32 m_nCmdID;

public:
	BEGIN_COM_MAP(CRibbonCommandItem)
        COM_INTERFACE_ENTRY(IUISimplePropertySet)
		COM_INTERFACE_ENTRY(IRibbonCommandItem)
    END_COM_MAP()

	STDMETHOD(Initialize)(PCWSTR commandName, UINT32 nCmdID); 
	STDMETHOD(GetCommandId)(UINT32 *commandId);
	STDMETHOD(GetValue)(__in REFPROPERTYKEY key, __out PROPVARIANT *ppropvar);

	CRibbonCommandItem(void);
	virtual ~CRibbonCommandItem(void);
};
